import request from "@/request/";

// 获取列表
export const getList = (data) => {
  return request({
    url: "/api/mes-production-service/work-station/page",
    method: "POST",
    data,
  });
};

// 获取详情
export const getDetail = (id) => {
  return request({
    url: "/api/mes-production-service/work-station/detail",
    method: "GET",
    params: {
      id,
    },
  });
};

// 新增
export const add = (data) => {
  return request({
    url: "/api/mes-production-service/work-station/save",
    method: "POST",
    data,
  });
};

// 更新
export const update = (data) => {
  return request({
    url: "/api/mes-production-service/work-station/update",
    method: "POST",
    data,
  });
};

// 更改状态
export const updateStatus = (data) => {
  return request({
    url: "/api/mes-production-service/work-station/enable-or-disable",
    method: "POST",
    data,
  });
};

// 获取设备名称下拉列表
export const getDeviceNameList = () => {
  return request({
    url: "/api/mes-production-service/work-station/add/device-name-list",
    method: "GET",
  });
};

// // 获取设备名称下拉列表
// export const getDeviceNameList = () => {
//   return request({
//     url: "/api/mes-equipment-service/device-ledger/rpc-page",
//     method: "GET",
//   });
// };

// 获取线体名称下拉列表
export const getLineNameList = () => {
  return request({
    url: "/api/mes-production-service/work-station/add/line-name-list",
    method: "GET",
  });
};

// 获取线体名称下的车间信息
export const getLineNameInOrg = (data) => {
  return request({
    url: "/api/mes-production-service/line/page",
    method: "POST",
    data,
  });
};

// 获取工序名称下拉列表
export const getProcessNameList = () => {
  return request({
    url: "/api/mes-production-service/work-station/add/process-name-list",
    method: "GET",
  });
};
